Skip to content

Updates of SQLite wrappers.#537

Merged
aregtech merged 1 commit intomasterfrom
feature/535-extend-sql-database-object-to-fetch-data
Jun 28, 2025
Merged

Updates of SQLite wrappers.#537
aregtech merged 1 commit intomasterfrom
feature/535-extend-sql-database-object-to-fetch-data

Conversation

@aregtech
Copy link
Owner

Added new SQLite wrapper classes to fetch data or run queries.

@aregtech aregtech requested review from Copilot and vukihub June 28, 2025 09:54
@aregtech aregtech self-assigned this Jun 28, 2025
@aregtech aregtech added the enhancement New feature or request label Jun 28, 2025
@aregtech aregtech linked an issue Jun 28, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces new SQLite wrapper classes for executing SQL statements and retrieving query results, and updates the existing SQLite database interface to support rollback functionality. Key changes include:

  • Addition of new classes: SqliteStatement and SqliteRow (both header and implementation).
  • Updates to SqliteDatabase and LogSqliteDatabase to use helper functions for cleaner type conversions and to support rollback.
  • Adjustments to project build files (CMakeLists.txt, vcxproj, and vcxproj.filters) to include the new source/header files.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
aregextend/db/private/SqliteStatement.cpp New implementation of the SQLite statement wrapper.
aregextend/db/private/SqliteRow.cpp New implementation of the SQLite row wrapper for fetching query results.
aregextend/db/private/SqliteDatabase.cpp Updates to use inline helper functions and add rollback support.
aregextend/db/private/LogSqliteDatabase.cpp Added rollback functionality.
aregextend/db/SqliteStatement.hpp New header for the SQLite statement wrapper.
aregextend/db/SqliteRow.hpp New header for the SQLite row wrapper.
aregextend/db/SqliteDatabase.hpp Updated to declare friend relationship and add rollback function.
aregextend/db/LogSqliteDatabase.hpp Added rollback declaration.
Various project files (CMakeLists.txt, vcxproj, vcxproj.filters) Updated to include the newly added source and header files.
areg/persist/IEDatabaseEngine.hpp Updated interface to include rollback functionality.
Comments suppressed due to low confidence (1)

framework/aregextend/db/SqliteStatement.hpp:280

  • The header declares a const overload for next(), but no corresponding implementation is provided. Please implement the const version or remove the declaration to avoid linker errors.
    bool next(void) const;

Comment on lines 128 to +130
constexpr std::string_view sqlRoolback{ "ROLLBACK;" };

return (mDbObject != nullptr ? SQLITE_OK == ::sqlite3_exec(reinterpret_cast<sqlite3*>(mDbObject), doCommit ? sqlCommit.data() : sqlRoolback.data(), nullptr, nullptr, nullptr) : false);
return (mDbObject != nullptr ? SQLITE_OK == ::sqlite3_exec(_sqlite(mDbObject), doCommit ? sqlCommit.data() : sqlRoolback.data(), nullptr, nullptr, nullptr) : false);
Copy link

Copilot AI Jun 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable name 'sqlRoolback' appears to be misspelled; consider renaming it to 'sqlRollback' for clarity.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@vukihub vukihub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine

@aregtech aregtech merged commit feafa8f into master Jun 28, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Extend sql database object to fetch data

3 participants